﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace jnxc.Web.collectinfo
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                       
        }

        		protected void btnSave_Click(object sender, EventArgs e)
		{
			
			string strErr="";
			if(!PageValidate.IsNumber(txtuid.Text))
			{
				strErr+="用户格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtpid.Text))
			{
				strErr+="商品或方案格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtctype.Text))
			{
				strErr+="商品0方案1格式错误！\\n";	
			}

			if(strErr!="")
			{
				MessageBox.Show(this,strErr);
				return;
			}
			int uid=int.Parse(this.txtuid.Text);
			int pid=int.Parse(this.txtpid.Text);
			int ctype=int.Parse(this.txtctype.Text);

			jnxc.Model.collectinfo model=new jnxc.Model.collectinfo();
			model.uid=uid;
			model.pid=pid;
			model.ctype=ctype;

			jnxc.BLL.collectinfo bll=new jnxc.BLL.collectinfo();
			bll.Add(model);
			jnxc.Common.MessageBox.ShowAndRedirect(this,"保存成功！","add.aspx");

		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
